﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.SpcManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.SpcManagement.SimpleDataVMs
{
    public partial class SimpleDataTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._SimpleData._BatchId")]
        public ExcelPropety BatchId_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.BatchId);
        [Display(Name = "_Model._SimpleData._Sn")]
        public ExcelPropety Sn_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.Sn);
        [Display(Name = "_Model._SimpleData._SimpleValue")]
        public ExcelPropety SimpleValue_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.SimpleValue);
        [Display(Name = "_Model._SimpleData._SimpleTime")]
        public ExcelPropety SimpleTime_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.SimpleTime, true);
        [Display(Name = "_Model._SimpleData._OpId")]
        public ExcelPropety OpId_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.OpId);
        [Display(Name = "_Model._SimpleData._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.ProductId);
        [Display(Name = "_Model._SimpleData._Sheet")]
        public ExcelPropety Sheet_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.SheetId);
        [Display(Name = "_Model._SimpleData._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.IsValid);
        [Display(Name = "_Model._SimpleData._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<SimpleData>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Sheet_Excel.DataType = ColumnDataType.ComboBox;
            Sheet_Excel.ListItems = DC.Set<SpcAnalysis>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class SimpleDataImportVM : BaseImportVM<SimpleDataTemplateVM, SimpleData>
    {
            //import

    }

}